﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;

namespace PhoneNumbersFounder
{
    class Program
    {
        static void Main(string[] args)
        {
            StreamReader reader = new StreamReader("input.txt");
            StreamWriter writer = new StreamWriter("output.txt");
            using (reader)
            {
                using (writer)
                {
                    string line = reader.ReadLine();
                    while (line != null)
                    {
                        MatchCollection matches = Regex.Matches(line, @"\(\+[0-9]{3}\)\s[0-9]{3}\s[0-9]{3}\-[0-9]{3}");
                        foreach (var item in matches)
                        {
                            writer.WriteLine(item);
                        }
                        line = reader.ReadLine();
                    }
                }

            }

        }
    }
}
